package com.aaa.controller;
import com.aaa.service.T_AppraisalScoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @Author: TT
 * @Date: 2019/3/23 14:36
 * @Version 1.0
 */
@Controller
@RequestMapping("/appraisalscore/")
public class T_AppraisalScoreController {
    @Autowired
    T_AppraisalScoreService service;
    @RequestMapping("go")
    public  String go(){
        return "appraisalscore/appraisalscore";
    }
    @RequestMapping("tolist")
    @ResponseBody
    public Map list(@RequestBody Map map){
        Map map1=new HashMap();
        map1.put("data",service.list(map));
        map1.put("total",service.getCount(map));
        map1.put("getdata",service.applist());
        return  map1;
    }
    @RequestMapping("fs")
    @ResponseBody
    public Integer score(@RequestBody Map map){
        Integer z=0;
        List list= (List) map.get("radios");
        for (int i = 0; i <list.size(); i++) {
                z =z + (int) list.get(i);
            System.out.println(z+"111111111111111111111");
        }
        Map map1=new HashMap();
        map1.put("id",map.get("id"));
        map1.put("appscore",z);
        System.out.println(map1);
        return service.score(map1);
    }
}
